package com.imooc.cloud.mall.practice.common.exception;

/**
 * ClassName: ImoocMallExceptionEnum
 * Package: com.imooc.mall.exception
 *
 * @Author 马学兴
 * @Create 2023/5/31 22:33
 * @Version 1.0
 * Description:异常枚举
 */
public enum ImoocMallExceptionEnum {


    REQUEST_PARAM_ERROR(10001,"参数有误"),
    NO_ENUM(10002,"找不到枚举"),
    NEED_USER_NAME(10003,"需要用户名"),
    NEED_PASSWORD(10004,"需要密码"),
    PASSWORD_TOO_SHORT(10005,"密码长度不能少于八位"),
    NAME_EXISTED(10006,"用户名已被注册"),
    INSERT_FAILED(10007,"插入失败，请重试"),
    WRONG_PASSWORD(10008,"密码错误"),
    UPDATE_FAILED(10009,"更新错误"),
    NEED_LOGIN(10010,"未登录"),
    NEED_ADMIN(10011,"非管理员"),
    CREATE_FAILED(10012,"创建失败"),
    DELETE_FAILED(10013,"删除失败"),
    MKDIR_FAILED(10014,"创建文件夹失败"),
    UPLOAD_FAILED(10015,"上传失败"),
    //NOT_EXIST(10016,"不存在该商品"),
    NOT_SALE(10016,"商品未上架"),
    NOT_ENOUGH(10017,"商品库存不足"),
    CART_EMPTY(10018,"购物车为空"),
    NO_ORDER(10019,"订单不存在"),
    NOT_YOUR_ORDER(10020,"不能操作非自己的订单"),
    WRONG_ORDER_STATUS(10021,"订单状态不符"),
    SYSTEM_ERROR(20000, "系统异常");
    Integer code;//异常码
    String msg;//异常信息

    ImoocMallExceptionEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
